package bsh;

import org.objectweb.asm.MethodVisitor;

import bsh.exception.CompilationFailedException;
import bsh.meta.Scope;
import bsh.meta.TypeWrapper;

/**
 * @author takeshi
 */
public interface NodeCompiler {

    /**
     * Compiles a node
     * 
     * @param host {@link MethodVisitor}
     * @param state {@link CompilationState}
     * @throws CompilationFailedException e
     */
    void compile(MethodVisitor host, CompilationState state)
            throws CompilationFailedException;

    /**
     * @param scope Scope
     * @return {@link TypeWrapper}
     * @throws CompilationFailedException e
     */
    TypeWrapper nodeResultType(Scope scope) throws CompilationFailedException;

}
